package com.gaohe.scp.service.impl;

import java.util.List;
import com.gaohe.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gaohe.scp.mapper.CsCarExplainMapper;
import com.gaohe.scp.domain.CsCarExplain;
import com.gaohe.scp.service.ICsCarExplainService;

/**
 * 车辆成交说明Service业务层处理
 * 
 * @author liuxiangyu
 * @date 2025-03-25
 */
@Service
public class CsCarExplainServiceImpl implements ICsCarExplainService 
{
    @Autowired
    private CsCarExplainMapper csCarExplainMapper;

    @Override
    public CsCarExplain selectCsCarExplainByCarId(Long carId)
    {
        return csCarExplainMapper.selectCsCarExplainByCarId(carId);
    }

    /**
     * 查询车辆成交说明
     * 
     * @param explainId 车辆成交说明主键
     * @return 车辆成交说明
     */
    @Override
    public CsCarExplain selectCsCarExplainByExplainId(Long explainId)
    {
        return csCarExplainMapper.selectCsCarExplainByExplainId(explainId);
    }

    /**
     * 查询车辆成交说明列表
     * 
     * @param csCarExplain 车辆成交说明
     * @return 车辆成交说明
     */
    @Override
    public List<CsCarExplain> selectCsCarExplainList(CsCarExplain csCarExplain)
    {
        return csCarExplainMapper.selectCsCarExplainList(csCarExplain);
    }

    /**
     * 新增车辆成交说明
     * 
     * @param csCarExplain 车辆成交说明
     * @return 结果
     */
    @Override
    public int insertCsCarExplain(CsCarExplain csCarExplain)
    {
        csCarExplain.setCreateTime(DateUtils.getNowDate());
        return csCarExplainMapper.insertCsCarExplain(csCarExplain);
    }

    /**
     * 修改车辆成交说明
     * 
     * @param csCarExplain 车辆成交说明
     * @return 结果
     */
    @Override
    public int updateCsCarExplain(CsCarExplain csCarExplain)
    {
        csCarExplain.setUpdateTime(DateUtils.getNowDate());
        return csCarExplainMapper.updateCsCarExplain(csCarExplain);
    }

    /**
     * 批量删除车辆成交说明
     * 
     * @param explainIds 需要删除的车辆成交说明主键
     * @return 结果
     */
    @Override
    public int deleteCsCarExplainByExplainIds(Long[] explainIds)
    {
        return csCarExplainMapper.deleteCsCarExplainByExplainIds(explainIds);
    }

    /**
     * 删除车辆成交说明信息
     * 
     * @param explainId 车辆成交说明主键
     * @return 结果
     */
    @Override
    public int deleteCsCarExplainByExplainId(Long explainId)
    {
        return csCarExplainMapper.deleteCsCarExplainByExplainId(explainId);
    }
}
